<?php defined('BASEPATH') or exit('No direct script access allowed');

class Admin_event extends Base_Model {

    public function __construct()
    {
        Events::register('Admin.Before.Login', array($this, 'string_return'));
        Events::register('Admin.After.Login', array($this, 'string_return'));
        Events::register('Admin.Index', array($this, 'admin_index'));
    }

    public function string_return($string)
    {
        return 'I returned a string. '.$string.' Cakes and Pies!';
    }

     public function admin_index($string)
    {
        $this->messages->add('Event test from model/events/admin_event '.$string,'error');
        return '';
    }
}